/**
    package: learn-go
    filename: main
    author: diogo@gmail.com
    time: 2022/6/13 23:04
**/
package main

import (
	"github.com/gogf/gf/frame/g"
	"github.com/gogf/gf/util/gconv"
)

func main() {

	type User struct {
		Uid  int
		Name string
	}
	params := g.Map{
		"uid":  1,
		"name": "john",
	}
	var user *User

	maping := make(map[string]string)
	maping["aid"] = "Uid"

	if err := gconv.Struct(params, &user, maping); err != nil {
		panic(err)
	}
	g.Dump(user)
	g.Dump(maping)

}
